<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

	<title>Module: Salamander::Drawing::Shapes</title>

	<link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />

	<script src="../../js/jquery.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="../../js/thickbox-compressed.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="../../js/quicksearch.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="../../js/darkfish.js" type="text/javascript"
		charset="utf-8"></script>

</head>
<body class="module">

	<div id="metadata">
		<div id="home-metadata">
			<div id="home-section" class="section">
        <h3 class="section-header">
          <a href="../../index.html">Home</a>
          <a href="../../index.html#classes">Classes</a>
          <a href="../../index.html#methods">Methods</a>
        </h3>
			</div>
		</div>

		<div id="file-metadata">
			<div id="file-list-section" class="section">
				<h3 class="section-header">In Files</h3>
				<div class="section-body">
					<ul>
					
						<li><a href="../../lib/salamander/drawing/shapes_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
							class="thickbox" title="lib/salamander/drawing/shapes.rb">lib/salamander/drawing/shapes.rb</a></li>
					
					</ul>
				</div>
			</div>

			
		</div>

		<div id="class-metadata">

			<!-- Parent Class -->
			

			<!-- Namespace Contents -->
			

			<!-- Method Quickref -->
			
			<div id="method-list-section" class="section">
				<h3 class="section-header">Methods</h3>
				<ul class="link-list">
					
					<li><a href="#method-i-polygon">#polygon</a></li>
					
					<li><a href="#method-i-star">#star</a></li>
					
				</ul>
			</div>
			

			<!-- Included Modules -->
			
			<div id="includes-section" class="section">
				<h3 class="section-header">Included Modules</h3>
				<ul class="link-list">
				
				
					<li><span class="include">Line</span></li>
				
				
				</ul>
			</div>
			
		</div>

		<div id="project-metadata">
			
			

			<div id="classindex-section" class="section project-section">
				<h3 class="section-header">Class Index
					<span class="search-toggle"><img src="../../images/find.png"
						height="16" width="16" alt="[+]"
						title="show/hide quicksearch" /></span></h3>
				<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
				<fieldset>
					<legend>Quicksearch</legend>
					<input type="text" name="quicksearch" value=""
						class="quicksearch-field" />
				</fieldset>
				</form>

				<ul class="link-list">
				
					<li><a href="../../Salamander.html">Salamander</a></li>
				
					<li><a href="../../Salamander/Actor.html">Salamander::Actor</a></li>
				
					<li><a href="../../Salamander/Drawing.html">Salamander::Drawing</a></li>
				
					<li><a href="../../Salamander/Drawing/Line.html">Salamander::Drawing::Line</a></li>
				
					<li><a href="../../Salamander/Drawing/Shapes.html">Salamander::Drawing::Shapes</a></li>
				
					<li><a href="../../Numeric.html">Numeric</a></li>
				
				</ul>
				<div id="no-class-search-results" style="display: none;">No matching classes.</div>
			</div>

			
		</div>
	</div>

	<div id="documentation">
		<h1 class="module">Salamander::Drawing::Shapes</h1>

		<div id="description">
			
		</div>

		<!-- Constants -->
		

		<!-- Attributes -->
		

		<!-- Methods -->
		
		<div id="public-instance-method-details" class="method-section section">
			<h3 class="section-header">Public Instance Methods</h3>

		
			<div id="polygon-method" class="method-detail ">
				<a name="method-i-polygon"></a>

				<div class="method-heading">
				
					<span class="method-name">polygon</span><span
						class="method-args">(sides, length)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<p>
Draws a regular polygon with &#8216;sides&#8217; sides, each of length
&#8216;length&#8217;
</p>
					

					
					<div class="method-source-code"
						id="polygon-source">
<pre>
    <span class="ruby-comment cmt"># File lib/salamander/drawing/shapes.rb, line 17</span>
17:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">polygon</span> (<span class="ruby-identifier">sides</span>, <span class="ruby-identifier">length</span>)
18:       <span class="ruby-identifier">sides</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
19:         <span class="ruby-identifier">line</span> <span class="ruby-identifier">length</span>
20:         <span class="ruby-identifier">turn</span> (<span class="ruby-value">360.0</span><span class="ruby-operator">/</span><span class="ruby-identifier">sides</span>).<span class="ruby-identifier">degrees</span>
21:       <span class="ruby-keyword kw">end</span>
22:     <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
			<div id="star-method" class="method-detail ">
				<a name="method-i-star"></a>

				<div class="method-heading">
				
					<span class="method-name">star</span><span
						class="method-args">(points, length)</span>
					<span class="method-click-advice">click to toggle source</span>
				
				</div>

				<div class="method-description">
					
					<p>
Draws a star-like shape with number &#8216;points&#8217; of points.
</p>
<p>
&#8216;points&#8217; must be odd.
</p>
					

					
					<div class="method-source-code"
						id="star-source">
<pre>
    <span class="ruby-comment cmt"># File lib/salamander/drawing/shapes.rb, line 8</span>
 8:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">star</span> (<span class="ruby-identifier">points</span>, <span class="ruby-identifier">length</span>)
 9:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;The star must have an odd number of points&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">points</span> <span class="ruby-operator">%</span> <span class="ruby-value">2</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
10:       <span class="ruby-identifier">points</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
11:         <span class="ruby-identifier">line</span> <span class="ruby-identifier">length</span>
12:         <span class="ruby-identifier">turn</span> (<span class="ruby-value">720.0</span><span class="ruby-operator">/</span><span class="ruby-identifier">points</span>).<span class="ruby-identifier">degrees</span>
13:       <span class="ruby-keyword kw">end</span>
14:     <span class="ruby-keyword kw">end</span></pre>
					</div>
					
				</div>

				

				
			</div>

		
		</div>
	

	</div>


	<div id="rdoc-debugging-section-dump" class="debugging-section">
	
		<p>Disabled; run with --debug to generate this.</p>
	
	</div>

	<div id="validator-badges">
		<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
		<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
			Rdoc Generator</a> 1.1.6</small>.</p>
	</div>

</body>
</html>

